home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / LISP Related / U. Mass AI & LISP Tools / INTERFACE / Grapher-Demo.lisp < prev    next >
Encoding:
Text File  |  1990-06-24  |  11.8 KB  |  517 lines  |  [TEXT/CCL ]

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;; Dan Suthers 24-Jun-90 23:48:18       
  3. ;;; Load this to see the grapher's capabilities in graphing hierarcies.
  4. ;;; The file defines some bogus SM structures simulating a frame hierarchy,
  5. ;;; then uses SM-OBJECTS->GRAPH-VIEW to graph them several ways (see the 
  6. ;;; end of the file for this and an optional additional demo.)
  7.  
  8. (in-package "USER")
  9.  
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11. ;;; These "frames" will be used to graph an "inheritance hierarchy"
  12. ;;; various ways.
  13.  
  14. (sm:dst (DEMO-FRAME 
  15.          (:comments "
  16.     Bogus 'frames' in an 'inheritance hierarchy', just for the purpose
  17.     of demonstrating grapher capabilities.")
  18.           (:redefine t)
  19.           (:sort-instances t))
  20.   (subclasses nil :type list))
  21.  
  22. (DEMO-FRAME <-SUBSUMPTION
  23.  :SUBCLASSES        nil)
  24.  
  25. (DEMO-FRAME >-SUBSUMPTION
  26.  :SUBCLASSES        nil)
  27.  
  28. (DEMO-FRAME ABSTRACTION
  29.  :SUBCLASSES        (mathematical-concept epistemic-concept physical-law process-concept))
  30.  
  31. (DEMO-FRAME ALUMINUM
  32.  :SUBCLASSES        nil)
  33.  
  34. (DEMO-FRAME ATOM
  35.  :SUBCLASSES        nil)
  36.  
  37. (DEMO-FRAME ATTRIBUTIVE
  38.  :SUBCLASSES        (made-of))
  39.  
  40. (DEMO-FRAME BINARY-EXPRESSION
  41.  :SUBCLASSES        
  42.  (binary-expression-4 binary-expression-6 binary-expression-2
  43.  binary-expression-5 binary-expression-1 binary-expression-8
  44.  binary-expression-3 binary-expression-7))
  45.  
  46. (DEMO-FRAME BINARY-EXPRESSION-1
  47.  :SUBCLASSES        nil)
  48.  
  49. (DEMO-FRAME BINARY-EXPRESSION-2
  50.  :SUBCLASSES        nil)
  51.  
  52. (DEMO-FRAME BINARY-EXPRESSION-3
  53.  :SUBCLASSES        nil)
  54.  
  55. (DEMO-FRAME BINARY-EXPRESSION-4
  56.  :SUBCLASSES        nil)
  57.  
  58. (DEMO-FRAME BINARY-EXPRESSION-5
  59.  :SUBCLASSES        nil)
  60.  
  61. (DEMO-FRAME BINARY-EXPRESSION-6
  62.  :SUBCLASSES        nil)
  63.  
  64. (DEMO-FRAME BINARY-EXPRESSION-7
  65.  :SUBCLASSES        nil)
  66.  
  67. (DEMO-FRAME BINARY-EXPRESSION-8
  68.  :SUBCLASSES        nil)
  69.  
  70. (DEMO-FRAME CAUSALITY
  71.  :SUBCLASSES        nil)
  72.  
  73. (DEMO-FRAME CHANGING
  74.  :SUBCLASSES        nil)
  75.  
  76. (DEMO-FRAME CHARGE
  77.  :SUBCLASSES        (negative-charge positive-charge charge-of-a-capacitor))
  78.  
  79. (DEMO-FRAME CHARGE-CURRENT-LAW
  80.  :SUBCLASSES        nil)
  81.  
  82. (DEMO-FRAME CHARGE-OF-A-CAPACITOR
  83.  :SUBCLASSES        nil)
  84.  
  85. (DEMO-FRAME CLORINE
  86.  :SUBCLASSES        nil)
  87.  
  88. (DEMO-FRAME COMPARATIVE
  89.  :SUBCLASSES        (identity distinction))
  90.  
  91. (DEMO-FRAME COMPOUND
  92.  :SUBCLASSES        (water))
  93.  
  94. (DEMO-FRAME CONCEPT-ASSOCIATION
  95.  :SUBCLASSES        (current-through-a-capacitor voltage-across-capacitor charge-of-a-capacitor))
  96.  
  97. (DEMO-FRAME CONDITIONAL
  98.  :SUBCLASSES        nil)
  99.  
  100. (DEMO-FRAME CONDITIONALITY
  101.  :SUBCLASSES        nil)
  102.  
  103. (DEMO-FRAME CONDUCTOR
  104.  :SUBCLASSES        nil)
  105.  
  106. (DEMO-FRAME CONSCIOUS-BEING
  107.  :SUBCLASSES        (person))
  108.  
  109. (DEMO-FRAME CONSTANT
  110.  :SUBCLASSES        nil)
  111.  
  112. (DEMO-FRAME CONSTRAINT
  113.  :SUBCLASSES        nil)
  114.  
  115. (DEMO-FRAME COPPER
  116.  :SUBCLASSES        nil)
  117.  
  118. (DEMO-FRAME CURRENT
  119.  :SUBCLASSES        (current-through-a-capacitor))
  120.  
  121. (DEMO-FRAME CURRENT-THROUGH-A-CAPACITOR
  122.  :SUBCLASSES        nil)
  123.  
  124. (DEMO-FRAME DECOMPOSABLE-OBJECT
  125.  :SUBCLASSES        (molecule atom ordered-object device element compound))
  126.  
  127. (DEMO-FRAME DEVICE
  128.  :SUBCLASSES        (electronic-device storage-device measuring-device))
  129.  
  130. (DEMO-FRAME DISTINCTION
  131.  :SUBCLASSES        nil)
  132.  
  133. (DEMO-FRAME EE-DEVELOPER-0
  134.  :SUBCLASSES        nil)
  135.  
  136. (DEMO-FRAME EE-DEVELOPER-1
  137.  :SUBCLASSES        nil)
  138.  
  139. (DEMO-FRAME EE-DEVELOPER-2
  140.  :SUBCLASSES        nil)
  141.  
  142. (DEMO-FRAME ELECTRICITY
  143.  :SUBCLASSES        nil)
  144.  
  145. (DEMO-FRAME ELECTRONIC-DEVICE
  146.  :SUBCLASSES        nil)
  147.  
  148. (DEMO-FRAME ELEMENT
  149.  :SUBCLASSES        (sodium iron gallium silicon oxygen aluminum hydrogen copper clorine))
  150.  
  151. (DEMO-FRAME ENTITY
  152.  :SUBCLASSES        (process object quality relation))
  153.  
  154. (DEMO-FRAME EPISTEMIC-CONCEPT
  155.  :SUBCLASSES        (measurement concept-association))
  156.  
  157. (DEMO-FRAME EQUIVALENCE
  158.  :SUBCLASSES        
  159.  (equivalence-4 equivalence-2 equivalence-5 equivalence-1 equivalence-6
  160.  equivalence-7 equivalence-3))
  161.  
  162. (DEMO-FRAME EQUIVALENCE-1
  163.  :SUBCLASSES        nil)
  164.  
  165. (DEMO-FRAME EQUIVALENCE-2
  166.  :SUBCLASSES        nil)
  167.  
  168. (DEMO-FRAME EQUIVALENCE-3
  169.  :SUBCLASSES        nil)
  170.  
  171. (DEMO-FRAME EQUIVALENCE-4
  172.  :SUBCLASSES        nil)
  173.  
  174. (DEMO-FRAME EQUIVALENCE-5
  175.  :SUBCLASSES        nil)
  176.  
  177. (DEMO-FRAME EQUIVALENCE-6
  178.  :SUBCLASSES        nil)
  179.  
  180. (DEMO-FRAME EQUIVALENCE-7
  181.  :SUBCLASSES        nil)
  182.  
  183. (DEMO-FRAME EVENT
  184.  :SUBCLASSES        nil)
  185.  
  186. (DEMO-FRAME EVIDENTIAL
  187.  :SUBCLASSES        (evidential-con evidential-pro))
  188.  
  189. (DEMO-FRAME EVIDENTIAL-CON
  190.  :SUBCLASSES        nil)
  191.  
  192. (DEMO-FRAME EVIDENTIAL-PRO
  193.  :SUBCLASSES        nil)
  194.  
  195. (DEMO-FRAME EXPRESSION
  196.  :SUBCLASSES        (constant parameter binary-expression variable equivalence))
  197.  
  198. (DEMO-FRAME FORCE
  199.  :SUBCLASSES        nil)
  200.  
  201. (DEMO-FRAME FUNCTION
  202.  :SUBCLASSES        nil)
  203.  
  204. (DEMO-FRAME FUNCTIONAL
  205.  :SUBCLASSES        nil)
  206.  
  207. (DEMO-FRAME FUNCTIONAL-OBJECT
  208.  :SUBCLASSES        (device plate))
  209.  
  210. (DEMO-FRAME GALLIUM
  211.  :SUBCLASSES        nil)
  212.  
  213. (DEMO-FRAME HAS-PART
  214.  :SUBCLASSES        nil)
  215.  
  216. (DEMO-FRAME HYDROGEN
  217.  :SUBCLASSES        nil)
  218.  
  219. (DEMO-FRAME IDENTIFICATION
  220.  :SUBCLASSES        nil)
  221.  
  222. (DEMO-FRAME IDENTITY
  223.  :SUBCLASSES        nil)
  224.  
  225. (DEMO-FRAME INDUCTANCE
  226.  :SUBCLASSES        nil)
  227.  
  228. (DEMO-FRAME INSULATOR
  229.  :SUBCLASSES        nil)
  230.  
  231. (DEMO-FRAME INTENSIONAL-QUALITY
  232.  :SUBCLASSES        (function))
  233.  
  234. (DEMO-FRAME IRON
  235.  :SUBCLASSES        nil)
  236.  
  237. (DEMO-FRAME LOCATION
  238.  :SUBCLASSES        nil)
  239.  
  240. (DEMO-FRAME MADE-OF
  241.  :SUBCLASSES        nil)
  242.  
  243. (DEMO-FRAME MATERIAL-PROCESS
  244.  :SUBCLASSES        nil)
  245.  
  246. (DEMO-FRAME MATERIAL-WORLD-QUALITY
  247.  :SUBCLASSES        (current charge voltage power force resistance inductance))
  248.  
  249. (DEMO-FRAME MATHEMATICAL-CONCEPT
  250.  :SUBCLASSES        (operator))
  251.  
  252. (DEMO-FRAME MEASUREMENT
  253.  :SUBCLASSES        nil)
  254.  
  255. (DEMO-FRAME MEASURING-DEVICE
  256.  :SUBCLASSES        nil)
  257.  
  258. (DEMO-FRAME MENTAL-PROCESS
  259.  :SUBCLASSES        nil)
  260.  
  261. (DEMO-FRAME MODAL-QUALITY
  262.  :SUBCLASSES        (nonconditional conditional volitional nonvolitional))
  263.  
  264. (DEMO-FRAME MODULARITY
  265.  :SUBCLASSES        (conditionality stasis changing causality))
  266.  
  267. (DEMO-FRAME MOLECULE
  268.  :SUBCLASSES        nil)
  269.  
  270. (DEMO-FRAME NECESSITY
  271.  :SUBCLASSES        nil)
  272.  
  273. (DEMO-FRAME NEGATIVE-CHARGE
  274.  :SUBCLASSES        nil)
  275.  
  276. (DEMO-FRAME NON-CONSCIOUS-ENTITY
  277.  :SUBCLASSES        nil)
  278.  
  279. (DEMO-FRAME NONCONDITIONAL
  280.  :SUBCLASSES        nil)
  281.  
  282. (DEMO-FRAME NONDECOMPOSABLE-OBJECT
  283.  :SUBCLASSES        (space-point time-point substance))
  284.  
  285. (DEMO-FRAME NONVOLITIONAL
  286.  :SUBCLASSES        (necessity possibility))
  287.  
  288. (DEMO-FRAME OBJECT
  289.  :SUBCLASSES        
  290.  (abstraction non-conscious-entity spatial-temporal-entity
  291.  nondecomposable-object conscious-being decomposable-object))
  292.  
  293. (DEMO-FRAME OHMS-LAW
  294.  :SUBCLASSES        nil)
  295.  
  296. (DEMO-FRAME OPERATOR
  297.  :SUBCLASSES        nil)
  298.  
  299. (DEMO-FRAME ORDERED-OBJECT
  300.  :SUBCLASSES        nil)
  301.  
  302. (DEMO-FRAME OXYGEN
  303.  :SUBCLASSES        nil)
  304.  
  305. (DEMO-FRAME PARAMETER
  306.  :SUBCLASSES        (parameter-c))
  307.  
  308. (DEMO-FRAME PARAMETER-C
  309.  :SUBCLASSES        nil)
  310.  
  311. (DEMO-FRAME PART-OF
  312.  :SUBCLASSES        nil)
  313.  
  314. (DEMO-FRAME PERSON
  315.  :SUBCLASSES        (ee-developer-2 ee-developer-1 ee-developer-0))
  316.  
  317. (DEMO-FRAME PHYSICAL-LAW
  318.  :SUBCLASSES        (charge-current-law power-law-dc ohms-law))
  319.  
  320. (DEMO-FRAME PLATE
  321.  :SUBCLASSES        nil)
  322.  
  323. (DEMO-FRAME POSITIVE-CHARGE
  324.  :SUBCLASSES        nil)
  325.  
  326. (DEMO-FRAME POSSIBILITY
  327.  :SUBCLASSES        nil)
  328.  
  329. (DEMO-FRAME POWER
  330.  :SUBCLASSES        nil)
  331.  
  332. (DEMO-FRAME POWER-LAW-DC
  333.  :SUBCLASSES        nil)
  334.  
  335. (DEMO-FRAME PREDICATE
  336.  :SUBCLASSES        
  337.  (evidential comparative attributive subsumption structural modularity
  338.  functional teleological constraint identification))
  339.  
  340. (DEMO-FRAME PROCESS
  341.  :SUBCLASSES        (material-process mental-process verbal-process storage-process))
  342.  
  343. (DEMO-FRAME PROCESS-CONCEPT
  344.  :SUBCLASSES        (storage state-transition state))
  345.  
  346. (DEMO-FRAME QUALITY
  347.  :SUBCLASSES        (material-world-quality intensional-quality modal-quality))
  348.  
  349. (DEMO-FRAME RELATION
  350.  :SUBCLASSES        (expression predicate))
  351.  
  352. (DEMO-FRAME RESISTANCE
  353.  :SUBCLASSES        nil)
  354.  
  355. (DEMO-FRAME SILICON
  356.  :SUBCLASSES        nil)
  357.  
  358. (DEMO-FRAME SODIUM
  359.  :SUBCLASSES        nil)
  360.  
  361. (DEMO-FRAME SPACE-POINT
  362.  :SUBCLASSES        nil)
  363.  
  364. (DEMO-FRAME SPATIAL-TEMPORAL-ENTITY
  365.  :SUBCLASSES        
  366.  (molecule atom ordered-object functional-object compound time event substance
  367.  person location element))
  368.  
  369. (DEMO-FRAME STASIS
  370.  :SUBCLASSES        nil)
  371.  
  372. (DEMO-FRAME STATE
  373.  :SUBCLASSES        nil)
  374.  
  375. (DEMO-FRAME STATE-TRANSITION
  376.  :SUBCLASSES        nil)
  377.  
  378. (DEMO-FRAME STORAGE
  379.  :SUBCLASSES        nil)
  380.  
  381. (DEMO-FRAME STORAGE-DEVICE
  382.  :SUBCLASSES        nil)
  383.  
  384. (DEMO-FRAME STORAGE-PROCESS
  385.  :SUBCLASSES        nil)
  386.  
  387. (DEMO-FRAME STRUCTURAL
  388.  :SUBCLASSES        (has-part structural-association part-of))
  389.  
  390. (DEMO-FRAME STRUCTURAL-ASSOCIATION
  391.  :SUBCLASSES        nil)
  392.  
  393. (DEMO-FRAME SUBATOMIC-PARTICLE
  394.  :SUBCLASSES        nil)
  395.  
  396. (DEMO-FRAME SUBSTANCE
  397.  :SUBCLASSES        (subatomic-particle electricity insulator conductor))
  398.  
  399. (DEMO-FRAME SUBSUMPTION
  400.  :SUBCLASSES        (>-subsumption <-subsumption))
  401.  
  402. (DEMO-FRAME TELEOLOGICAL
  403.  :SUBCLASSES        nil)
  404.  
  405. (DEMO-FRAME TIME
  406.  :SUBCLASSES        nil)
  407.  
  408. (DEMO-FRAME TIME-POINT
  409.  :SUBCLASSES        nil)
  410.  
  411. (DEMO-FRAME VARIABLE
  412.  :SUBCLASSES        
  413.  (variable-p variable-t variable-q variable-i variable-v variable-r
  414.  variable-v-across-capacitor variable-c variable-i-across-capacitor))
  415.  
  416. (DEMO-FRAME VARIABLE-C
  417.  :SUBCLASSES        nil)
  418.  
  419. (DEMO-FRAME VARIABLE-I
  420.  :SUBCLASSES        nil)
  421.  
  422. (DEMO-FRAME VARIABLE-I-ACROSS-CAPACITOR
  423.  :SUBCLASSES        nil)
  424.  
  425. (DEMO-FRAME VARIABLE-P
  426.  :SUBCLASSES        nil)
  427.  
  428. (DEMO-FRAME VARIABLE-Q
  429.  :SUBCLASSES        nil)
  430.  
  431. (DEMO-FRAME VARIABLE-R
  432.  :SUBCLASSES        nil)
  433.  
  434. (DEMO-FRAME VARIABLE-T
  435.  :SUBCLASSES        nil)
  436.  
  437. (DEMO-FRAME VARIABLE-V
  438.  :SUBCLASSES        nil)
  439.  
  440. (DEMO-FRAME VARIABLE-V-ACROSS-CAPACITOR
  441.  :SUBCLASSES        nil)
  442.  
  443. (DEMO-FRAME VERBAL-PROCESS
  444.  :SUBCLASSES        nil)
  445.  
  446. (DEMO-FRAME VOLITIONAL
  447.  :SUBCLASSES        nil)
  448.  
  449. (DEMO-FRAME VOLTAGE
  450.  :SUBCLASSES        (voltage-across-capacitor voltage-1 voltage-2))
  451.  
  452. (DEMO-FRAME VOLTAGE-1
  453.  :SUBCLASSES        nil)
  454.  
  455. (DEMO-FRAME VOLTAGE-2
  456.  :SUBCLASSES        nil)
  457.  
  458. (DEMO-FRAME VOLTAGE-ACROSS-CAPACITOR
  459.  :SUBCLASSES        nil)
  460.  
  461. (DEMO-FRAME WATER
  462.  :SUBCLASSES        nil)
  463.  
  464. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  465.  
  466. (oneof grapher:*graph-window* 
  467.        :graph-view (grapher:sm-type->graph-view
  468.                     'demo-frame 'subclasses '(entity)
  469.                     t ':radial ':reduce-crossings 2 nil 
  470.                     #'symbol-name)
  471.        :window-size (make-point 500 400)
  472.        :window-position (make-point 2 (+ 2 *menubar-bottom*))
  473.        :window-title "Radial Style")
  474.  
  475. (oneof grapher:*graph-window* 
  476.        :graph-view (grapher:sm-type->graph-view
  477.                     'demo-frame 'subclasses '(entity)
  478.                     t ':vertical-tree ':reduce-crossings 2 nil 
  479.                     #'symbol-name)
  480.        :window-size (make-point 500 300)
  481.        :window-position (make-point 22 (+ 22 *menubar-bottom*))
  482.        :window-title "Vertical-Tree Style")
  483.  
  484. (oneof grapher:*graph-window* 
  485.        :graph-view (grapher:sm-type->graph-view
  486.                     'demo-frame 'subclasses '(entity)
  487.                     t ':horizontal-tree ':reduce-crossings 2 nil 
  488.                     #'symbol-name)
  489.        :window-size (make-point 500 300)
  490.        :window-position (make-point 42 (+ 42 *menubar-bottom*))
  491.        :window-title "Horizontal-Tree Style")
  492.  
  493. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  494. ;;; The following is an ugly interconnected graph that I used to test
  495. ;;; the grapher on graphs with backlinks, cycles, etc. (i.e., general
  496. ;;; graphs, not trees).  Evaluate this if you want to see how it does.
  497. #|
  498. (progn
  499.   (sm:dst CIRCULAR-REFERENCES
  500.           pointer)
  501.   (circular-references A :pointer (b c))
  502.   (circular-references B :pointer (d e))
  503.   (circular-references C :pointer (e))
  504.   (circular-references D :pointer (g h))
  505.   (circular-references E :pointer (f))
  506.   (circular-references F :pointer nil)
  507.   (circular-references G :pointer (b))
  508.   (circular-references H :pointer (a))
  509.   (grapher:graph-sm-objects 'circular-references 'pointer '(a)
  510.                             t :horizontal-tree :reduce-crossings 5)
  511.   )
  512. |#
  513.  
  514.  
  515. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  516. ;;; EOF
  517.